package com.samphanie.auiu.auth.service;

import com.samphanie.auiu.common.dto.CreateOrUpdateClientDto;
import com.samphanie.auiu.common.dto.CreateUserDto;
import com.samphanie.auiu.common.dto.UpdateUserDto;
import com.samphanie.auiu.mbg.model.SysRole;
import com.samphanie.auiu.mbg.model.User;
import com.samphanie.auiu.mbg.utils.PageUtils;
import org.springframework.security.oauth2.provider.ClientDetails;

import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;

/**
 * @author ZSY
 * @email 1451691457@qq.com
 */
public interface IUserAdminService {

    Set<SysRole> findAvailableRolesByUserId(String username);

    ClientDetails updateClientDetails(CreateOrUpdateClientDto clientDto);

    Optional<User> findByUsername(String username);

    PageUtils findAllUser(Map<String, Object> parameters);

    boolean createUser(CreateUserDto createUserDto);
    User saveOrUpdateUser(User user);
    boolean updateUser(UpdateUserDto userDto);

    User toggleEnabled(String username);

    void validateUserUniqueFields(String username, String email, String mobile);
    /**
     * 判断用户是否存在
     */
    boolean isUsernameExisted(String username);

    boolean isEmailExisted(String email);

    boolean isMobileExisted(String mobile);

    Optional<User> getUserInfoById(Long id);

    boolean deleteUser(List<Long> ids);
}
